[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 20
airjuggle = 25
sparkno = S6001
guard.sparkno = -1
KO.echo = 0
volume = 0
IntPersistIndex = 0
FloatPersistIndex = 0

[Size]
xscale = 1
yscale = 1
ground.back = 13
ground.front = 13
air.back = 13
air.front = 13
height = 40
attack.dist = 80
proj.attack.dist = 80
proj.doscale = 2
head.pos = -1, -60
mid.pos = -1, -40
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.1
walk.back = -1.95
run.fwd  = 3.9,-4.5
run.back = -2.9,-4.5
jump.neu = 0,-8.75
jump.back = -1.9
jump.fwd = 2.15
runjump.back = -1.6,-3.1
runjump.fwd = 1.8,-3.1
airjump.neu = 0
airjump.back = 0
airjump.fwd = 0

[Movement]
airjump.num = 0
airjump.height = 0
yaccel = .44
stand.friction = .85
crouch.friction = .82

[Quotes]
victory1 = "Only with my great kicking skills can I achieve victory!"
victory2 = "When this is over, would you care to train with the Kick Master himself?"
victory3 = "With every loss, there is something to learn. I hope you figure it out."
victory4 = "Your skills are no match for my kicks!"
victory5 = "Throw anything you can at me, my legs can deal with it all!"
victory6 = "Hmph, looks like I should train more..."
victory7 = "Your fist work is remarkable! I was waiting to spar with a Punch Master!"
victory8 = "I still look for the day I will find a proper Punch Master..." 
victory9 = "Your weaponry is impressive, back it up with some refined kicks though."
victory10 = "Your potential is great, kid. I see a great fighter in you!"
;---------------------------------------------------------------------------
;Var List

;***Universal***
;var(0) = Command variable
;var(1) = Famicom Fighters character detection
;var(2) = First hit counter
;var(3) = Helper select
;var(4) = Victory quote variable
;var(5) = Juggle Count
;var(6) = Helper health
;var(7) = Helper meter
;var(8) = Pause variable
;var(9) = Special move combo condition
;var(10) = Command Detection
;var(20) = Detection for first hit of multi-hit/multi-state moves
;var(21) = Test Var
;var(22) = Identification Variable
;var(23) = Counter for Training Mode Detection
;var(24) = Training Mode Var	  
;var(25) = Death State Check
;var(27) = Test Var
;var(28) = Super Finish
;var(30) = Hide helper bars and move names
;var(31) = Max helper health
;var(32) = Countdown for helper select
;var(33) = Back Charge
;var(34) = Back Charge Ready
;var(35) = Down Charge
;var(36) = Down Charge Ready
;var(37) = Projectile Ready
;var(38) = Helper Ready
;var(39) = Helper Projectile Ready
;var(40) = Air Guard Option
;var(41) = Air Recovery Option
;var(42) = Helpers Option
;var(43) = Pause Option 
;var(44) = Control Scheme
;var(45) = Standalone Helper Bar (X-Position)
;var(46) = Standalone Helper Bar (Y-Position)
;var(47) = Standalone Helper Bar (BG)
;var(48) = Alt Victory Music
;var(50) = Reaction var
;var(51) = Tag team var
;var(52) = Projectile animation var
;var(53) = Assist check
;var(54) = Hyper Tag-In check
;var(55) = AI switch check
;var(58) = Special move command time var
;var(59) = AI Var
;fvar(0) = Helper bars scaling
;fvar(20) = Damage scaling, current power
;fvar(21) = Damage scaling, future power
;fvar(24) = Test Var
;fvar(30) = Special projectile Vel X
;fvar(31) = Special projectile Vel Y
;fvar(32) = Super projectile Vel X
;fvar(33) = Super projectile Vel Y
;fvar(34) = Helper projectile Vel X
;fvar(35) = Helper projectile Vel Y
;fvar(36) = Helper Vel X
;fvar(37) = Helper Vel Y

;***Specific***
;var(11) = Win quote decider vs. fist-only fighters
;var(12) = "Hit" Counter for Sky High Kick
;var(47) = Winquote vs. Fist Fighters character identifier
;fvar(10) = Air X-acceleration during air moves (Also used for keeping track of Thonolan's x position during Sky High Kick)
;fvar(11) = Air Y-acceleration during air moves

;***Helpers***
;(Almost?) Universal
;-fvar(1) = Pos X coordinates
;-fvar(2) = Pos Y coordinates
;(EX-Bouncing Ball)
;-Var(0) = Life
;(Rat Knight)
;-Var(0) = Previous State (used by blocking state)
;Helper Projectiles (Universal)
;-Var(0) = Juggle

;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
anim = 5600
velset = 0,0

[State 170, 1]
type = PlaySnd
trigger1 = !Time
value = S11,1
channel = 10

[State 170, 2]
type = PosSet
trigger1 = !AnimTime
y = 1000

[State 170, 3]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
flag2 = nomusic
flag3 = noshadow

[State 170, 4]
type = AssertSpecial
trigger1 = AnimTime > 0
flag = roundnotover

;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
triggerall = !MatchOver
trigger1 = !Time
value = 181+8*(enemy,Name = "Bonus" && enemy,Var(0) = 0 && enemy,Var(5) = 0)

[State 180, 2]
type = ChangeState
triggerall = MatchOver
trigger1 = !Time
value = 182+Cond(enemy,Name = "Bonus" && enemy,Var(0) = 0 && enemy,Var(5) = 0,7,Cond(Var(3) = 1,1,0))
;---------------------------------------------------------------------------
;Round Win
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = S180,1
;---------------------------------------------------------------------------
;Match Win
[Statedef 182]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = AssertSpecial
trigger1 = Time < 330
flag = roundnotover

[State 181, 2]
type = Explod
trigger1 = AnimElem = 10
anim = 903
ID = 182
pos = 0,0
postype = p1 
removetime = -1
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ownpal = 1
shadow = -1

[State 181, 3]
type = PlaySnd
triggerall = !NumPartner
trigger1 = !Time
value = S180,0

[State 181, 4]
type = PlaySnd
triggerall = NumPartner
trigger1 = (ID = 56 || ID = 58) && !Time
trigger2 = (ID = 57 || ID = 59) && partner,Alive = 0 && !Time
value = S180,0

[State 181, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = F0,1 

;---------------------------------------------------------------------------
;Match Win
[Statedef 183]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = AssertSpecial
trigger1 = Time <= 1120
flag = roundnotover

[State 181, 2]
type = Explod
trigger1 = AnimElem = 10
anim = 903
ID = 182
pos = 0,0
postype = p1
removetime = -1
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ownpal = 1

[State 181, 3]
type = PlaySnd
triggerall = !NumPartner
trigger1 = !Time
value = S180,0

[State 181, 4]
type = PlaySnd
triggerall = NumPartner
trigger1 = (ID = 56 || ID = 58) && !Time
trigger2 = (ID = 57 || ID = 59) && partner,Alive = 0 && !Time
value = S180,0

[State 181, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = F0,1 

[State 181, 5]
type = PlaySnd
trigger1 = Time = 320
value = S7160,0

[State 0, Explod]
type = Explod
trigger1 = Time = 320
anim = 7160
ID = 7160
pos = ceil((60+random%240)*const(size.xscale)),ceil(300*const(size.yscale))
postype = left
facing = 1
vfacing = 1
bindtime = 1
vel = 0,-.5*const(size.yscale)
removetime = -1
scale = const(size.xscale),const(size.yscale)
sprpriority = 0
ontop = 1
ownpal = 1
;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 190
;velset = 2,2
sprpriority = 5

[State 191, 1]
type = AssertSpecial
trigger1 = Time < 115
flag = Intro
flag2 = invisible

[State 191, 2]
type = Null
trigger1 = 1
value = 0

[State 191, 3]
type = Explod
trigger1 = Time = 1
anim = 190
ID = 190
pos = ceil(-180*const(size.xscale)),ceil(-180*const(size.yscale))
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = 2*const(size.xscale),2*const(size.yscale)
removetime = 90
pausemovetime = 0
scale = const(size.xscale),const(size.yscale)
sprpriority = 0
ontop = 0
shadow = -1
ownpal = 0
removeongethit = 0

[State 191, 4]
type = Explod
trigger1 = Time = 91
anim = 191
ID = 190
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
removetime = -2
pausemovetime = 0
scale = const(size.xscale),const(size.yscale)
sprpriority = 0
ontop = 0
shadow = -1
ownpal = 0
removeongethit = 0

[State 191, 3]
type = Null
trigger1 = Anim = 190 && !Time
x = -250*(Facing)
y = -180

[State 191, 5]
type = ChangeAnim
trigger1 = Anim = 190 && Time = 91
value = 191

[State 191, 5]
type = Null
trigger1 = Pos Y >= 0
x = 0
y = 0

[State 191, 6]
type = PlaySnd
trigger1 = AnimElem = 2 && Anim = 190
value = S190,0
channel = 1

[State 191, 7]
type = ChangeState
trigger1 = Anim = 191 && !AnimTime
value = 0
;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
movetype = I
physics = S
ctrl = 0
anim = 195+1*(Facing = -1)
velset = 0,0
sprpriority = 2

[State 195, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = S195,0

[State 195, 2]
type = CtrlSet
trigger1 = Time = 47
value = 1
;========================<EXPLODSIVE BUFFERING HELPER>=============================
[StateDef 90000005]
type = A
physics = N
moveType = I
anim = 1
velSet = 0,0
ctrl = 0
     
[State 90000005, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "by JustMorphPointman"
ignoreHitPause = 1
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40]
Type= ChangeState
Triggerall= !Time
Triggerall= var(59)
trigger1 = (enemy,fvar(30) = 0) || (enemy,fvar(32) = 0)  || (enemy,fvar(34) = 0) 
trigger1 = (enemy,fvar(31) = -999) || (enemy,fvar(33)  = -999) || (enemy,fvar(35) = -999)
trigger1 = (P2MoveType != H) && !(enemynear(0),Pos Y >= -50)
trigger1 = random<var(50)*0.7
value=0
ctrl=1

[State 40, 1]
type = VarSet
trigger1 = !Time
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger1 = !var(59)
trigger2 = var(59)
trigger2 = (P2MoveType = H) && enemynear(0),Pos Y < -50
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
trigger1 = !var(59)
trigger2 = var(59)
trigger2 = random>var(50)*0.01
trigger2 = (P2MoveType != H) && !(enemynear(0),Pos Y >= -50)
trigger2 = (enemy,fvar(30) = 0) || (enemy,fvar(32) = 0)  || (enemy,fvar(34) = 0) 
trigger2 = (enemy,fvar(31) = -999) || (enemy,fvar(33)  = -999) || (enemy,fvar(35) = -999)
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = !AnimTime
x = Cond(sysvar(1)=0, const(velocity.jump.neu.x), Cond(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))*const(size.xscale)
y = const(velocity.jump.y)*const(size.yscale)

[State 40, 5]
type = VelSet
trigger1 = !AnimTime
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1

[State 40, 7]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1
;---------------------------------------------------------------------------
;HIT_DEFEATED
[Statedef 5600]
type    = L
movetype= H
physics = N
sprpriority = -3
velset = 0,0
anim = 5600
ctrl = 0

[State 5400, 1]
type = PlaySnd
trigger1 = !Time
value = S11,1
channel = 10

[State 5400, 2]
type = PosSet
trigger1 = !AnimTime
y = 1000

[State 5400, 3]
type = ChangeState
trigger1 = !AnimTime
value = 5150

[State 5400, 5]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = noshadow

[State 5400, 6]
type = AssertSpecial
trigger1 = 1
flag = roundnotover
